SPM: Shorten names of types and functions
authorAntonio Nino Diaz <[email protected]>
Tue, 22 May 2018 15:26:48 +0000 (16:26 +0100)
committerAntonio Nino Diaz <[email protected]>
Wed, 23 May 2018 12:50:18 +0000 (13:50 +0100)
The current internal names are too long, which makes it hard to write
code as many lines overflow the limit and need to be split, which may
not help the reader.

Change-Id: I072bdc8f3dd125255063ffa7f02500e5228fc9a1
Signed-off-by: Antonio Nino Diaz <[email protected]>
services/std_svc/spm/sp_setup.c
services/std_svc/spm/sp_xlat.c
services/std_svc/spm/spm_main.c
services/std_svc/spm/spm_private.h

index de031d82af0fb203fd3bf8febad965f17d378310..de27e3e9b2bac40c5521cd71eb05cfc8d42df1c8 100644 (file)
@@ -21,7 +21,7 @@
 #include "spm_shim_private.h"
 
 /* Setup context of the Secure Partition */
-void secure_partition_setup(secure_partition_context_t *sp_ctx)
+void spm_sp_setup(sp_context_t *sp_ctx)
 {
        cpu_context_t *ctx = &(sp_ctx->cpu_ctx);
 
index b192b0cec4fc7d7600f518094178784055d6147e..2aa2fa135763a51a4178a7a098e2c3e8a3fe7555 100644 (file)
@@ -105,7 +105,7 @@ static unsigned int smc_mmap_to_smc_attr(unsigned int attr)
        return smc_attr;
 }
 
-int32_t spm_memory_attributes_get_smc_handler(secure_partition_context_t *sp_ctx,
+int32_t spm_memory_attributes_get_smc_handler(sp_context_t *sp_ctx,
                                              uintptr_t base_va)
 {
        uint32_t attributes;
@@ -127,7 +127,7 @@ int32_t spm_memory_attributes_get_smc_handler(secure_partition_context_t *sp_ctx
        }
 }
 
-int spm_memory_attributes_set_smc_handler(secure_partition_context_t *sp_ctx,
+int spm_memory_attributes_set_smc_handler(sp_context_t *sp_ctx,
                                          u_register_t page_address,
                                          u_register_t pages_count,
                                          u_register_t smc_attributes)
index 133eea295cca2e840fbbf6ca83a516ed3a4f80f3..a72407e885eda27cfec760d1bbb7b9c5a7ac448f 100644 (file)
 /*******************************************************************************
  * Secure Partition context information.
  ******************************************************************************/
-static secure_partition_context_t sp_ctx;
+static sp_context_t sp_ctx;
 
 /*******************************************************************************
  * This function takes an SP context pointer and prepares the CPU to enter.
  ******************************************************************************/
-static void spm_sp_prepare_enter(secure_partition_context_t *sp_ctx)
+static void spm_sp_prepare_enter(sp_context_t *sp_ctx)
 {
        assert(sp_ctx != NULL);
 
@@ -50,7 +50,7 @@ static void spm_sp_prepare_enter(secure_partition_context_t *sp_ctx)
 /*******************************************************************************
  * Enter SP after preparing it with spm_sp_prepare_enter().
  ******************************************************************************/
-static uint64_t spm_sp_enter(secure_partition_context_t *sp_ctx)
+static uint64_t spm_sp_enter(sp_context_t *sp_ctx)
 {
        /* Enter Secure Partition */
        return spm_secure_partition_enter(&sp_ctx->c_rt_ctx);
@@ -62,7 +62,7 @@ static uint64_t spm_sp_enter(secure_partition_context_t *sp_ctx)
 static int32_t spm_init(void)
 {
        uint64_t rc = 0;
-       secure_partition_context_t *ctx;
+       sp_context_t *ctx;
 
        INFO("Secure Partition init...\n");
 
@@ -86,7 +86,7 @@ static int32_t spm_init(void)
  ******************************************************************************/
 int32_t spm_setup(void)
 {
-       secure_partition_context_t *ctx;
+       sp_context_t *ctx;
 
        /* Disable MMU at EL1 (initialized by BL2) */
        disable_mmu_icache_el1();
@@ -99,7 +99,7 @@ int32_t spm_setup(void)
        /* Assign translation tables context. */
        ctx->xlat_ctx_handle = spm_get_sp_xlat_context();
 
-       secure_partition_setup(ctx);
+       spm_sp_setup(ctx);
 
        /* Register init function for deferred init.  */
        bl31_register_bl32_init(&spm_init);
index 28bf6f17113741ffd936f89db4cb891e2c239be9..598762e2a4585b8238ad4ce818c10b4ddde78252 100644 (file)
 #include <stdint.h>
 #include <xlat_tables_v2.h>
 
-typedef struct secure_partition_context {
+typedef struct sp_context {
        uint64_t c_rt_ctx;
        cpu_context_t cpu_ctx;
        xlat_ctx_t *xlat_ctx_handle;
        unsigned int sp_init_in_progress;
        spinlock_t lock;
-} secure_partition_context_t;
+} sp_context_t;
 
 /* Assembly helpers */
 uint64_t spm_secure_partition_enter(uint64_t *c_rt_ctx);
 void __dead2 spm_secure_partition_exit(uint64_t c_rt_ctx, uint64_t ret);
 
-void secure_partition_setup(secure_partition_context_t *sp_ctx);
+void spm_sp_setup(sp_context_t *sp_ctx);
 
 xlat_ctx_t *spm_get_sp_xlat_context(void);
 
-int32_t spm_memory_attributes_get_smc_handler(secure_partition_context_t *sp_ctx,
+int32_t spm_memory_attributes_get_smc_handler(sp_context_t *sp_ctx,
                                              uintptr_t base_va);
-int spm_memory_attributes_set_smc_handler(secure_partition_context_t *sp_ctx,
+int spm_memory_attributes_set_smc_handler(sp_context_t *sp_ctx,
                                          u_register_t page_address,
                                          u_register_t pages_count,
                                          u_register_t smc_attributes);